//
//  AppConfig.m
//  Uang Pasti
//
//  Created by 李永彬 on 2025/8/15.
//

#import "AppConfig.h"

@implementation AppConfig

+ (instancetype)sharedInstance {
    static AppConfig *sharedInstance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        sharedInstance = [[AppConfig alloc] init];
        sharedInstance.countryId = @"";
        sharedInstance.appCountryEnv = AppCountryEnvUnknown;
    });
    return sharedInstance;
}

- (void)setCountryId:(NSString *)countryId {
    _countryId = [countryId copy];
    if ([countryId isEqualToString:@"830"]) {
        _appCountryEnv = AppCountryEnvIndonesia;
    } else if ([countryId isEqualToString:@"832"]) {
        _appCountryEnv = AppCountryEnvIndia;
    } else {
        _appCountryEnv = AppCountryEnvUnknown;
    }
}

#pragma mark - 语言相关方法
- (NSString *)appLanguageCode {
    if ([AppConfig sharedInstance].appCountryEnv == AppCountryEnvIndonesia) {
        return @"id";
    }
    return @"en";
}

@end
